package com.mz.ozy.mvp.presenter;


import android.app.Activity;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.TbRecrodBean;
import com.mz.ozy.mvp.model.TbRecordModel;
import com.mz.ozy.mvp.view.TbRecordContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class TbRecordPresenter extends BasePresenterImpl<TbRecordContract.View> implements TbRecordContract.Presenter {

    private TbRecordModel mModel;

    public TbRecordPresenter() {
        mModel = new TbRecordModel();
    }


    @Override
    public void getTbRecord(Activity activity, String pageNo, String coinCode, int wallettype) {
        mModel.getTbRecord(activity, pageNo, coinCode, wallettype)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<TbRecrodBean>(mView, false) {
                    @Override
                    public void onSuccesss(TbRecrodBean bean) {
                        mView.getTbRecordSuccess(bean);
                    }
                });
    }
}
